#include <iostream>
#include <string>
#include <cstring>
using namespace std;

const int N = 100003, null = 0x3f3f3f3f; //选这个数做null是因为这个数大于10e9，理论上大于10e9的数都行，用这个是为了方便memset初始化
string op;
int n, x;

class my_hash
{
private:
    int h[N];
    int ha(int x);

public:
    my_hash();
    void insert(int x);
    bool find(int x);
};

int my_hash::ha(int x)
{
    return (x % N + N) % N;
}

my_hash::my_hash()
{
    memset(h, 0x3f, sizeof h); //memset初始化是按位操作的，所以这里只要3f就行
}

bool my_hash::find(int x)
{
    int t = ha(x);
    while (h[t] != null)
    {
        if (h[t] == x)
            return true;
        ++t;
        if (t == N)
            t = 0;
    }
    return false;
}

void my_hash::insert(int x)
{
    if (find(x))
        return;
    int t = ha(x);
    while (h[t] != null)
    {
        ++t;
        if (t == N)
            t = 0;
    }
    h[t] = x;
    return;
}

int main()
{
    cin >> n;
    my_hash H;
    while (n--)
    {
        cin >> op;
        if (op[0] == 'I')
        {
            cin >> x;
            H.insert(x);
        }
        else
        {
            cin >> x;
            if (H.find(x))
                cout << "Yes" << endl;
            else
                cout << "No" << endl;
        }
    }
    return 0;
}